using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SQLString
{
	public partial class fUserAppSettings : Form
	{
		const string SelectFont="font";
		const string SelectColor="color";
		const string SelectTemp="template definition";
		const string SelectExt = "external programs";


		public fUserAppSettings()
		{
			InitializeComponent();
			cmdBackColor.BackColor = SystemColors.Window;		//these will become user property class settings.
			cmdForeColor.BackColor = SystemColors.WindowText;
		}

		private void button1_Click( object sender, EventArgs e )
		{
			dlgColor.ShowDialog(this);
		}

		private void lstProperties_SelectedIndexChanged( object sender, EventArgs e )
		{
			try
			{
				switch (lstProperties.SelectedItem.ToString().Trim().ToLower())
				{
					case SelectFont:
						pnlExtProg.Visible = false;
						pnlTemplate.Visible = false;
						pnlFont.Visible = true;
						break;
					case SelectExt:
						pnlExtProg.Visible = true;
						pnlTemplate.Visible = false;
						pnlFont.Visible = false;
						break;
					case SelectTemp:
						pnlExtProg.Visible = false;
						pnlTemplate.Visible = true;
						pnlFont.Visible = false;
						break;
				}
			}
			catch (Exception ex)
			{

			}
		}

		private void cmdBackColor_Click( object sender, EventArgs e )
		{
			DialogResult dlgShowColorDialog = dlgColor.ShowDialog(this);
			if (dlgShowColorDialog == DialogResult.OK)
			{
				cmdBackColor.BackColor = dlgColor.Color;
			}
		}

		private void cmdForeColor_Click( object sender, EventArgs e )
		{
			DialogResult dlgShowForeColorDialog = dlgColor.ShowDialog(this);
			if (dlgShowForeColorDialog == DialogResult.OK)
			{
				cmdForeColor.BackColor = dlgColor.Color;
			}
		}
	}
}